<template>
    {{test1}}{{test2}}{{demoTest}}{{demoTest2}}*{{demos.test}}*
</template>

<script>
import { mapState } from 'vuex'
export default {
    props: ['receive'],
    computed: {
        test1() {
            return this.$store.state.demos.test
        },
        test2() {
            return this.$store.state.demos.test+2
        },
        ...mapState(['demos']),
        // ...mapState({
        //     demoTest: 'demoTest',demoTest2: 'demoTest2' // test3: 'demoTest'返回的是一个函数，通过ES6解构赋值可以直接展示test3和test4的
        // })
        ...mapState(['demoTest','demoTest2']) // 上面的简写
    },
}
</script>

<style>

</style>